#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableLimitChallengeLevelDao:DaoBase<TableLimitChallengeLevel>
    {
        public override string GetFileName()
        {
            return "TableLimitChallengeLevel.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableLimitChallengeLevel>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableLimitChallengeLevel model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.id)) UnityEngine.Debug.LogError("数据表id重复:TableLimitChallengeLevel->id: " + model.id);
            #endif
            cachePrimaryInt[model.id] = model;
        }
        protected override TableLimitChallengeLevel ParseRowData(string[] rowData)
        {
            TableLimitChallengeLevel data = new TableLimitChallengeLevel();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.id = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.level = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.bossId = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.needHeroLevel = int.Parse(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.condition1 = string.Intern(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.conditionReward1 = string.Intern(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.conditionText1 = string.Intern(rowData[6]);
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.condition2 = string.Intern(rowData[7]);
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.conditionReward2 = string.Intern(rowData[8]);
            }
            if (!string.IsNullOrEmpty(rowData[9]))
            {
                data.conditionText2 = string.Intern(rowData[9]);
            }
            if (!string.IsNullOrEmpty(rowData[10]))
            {
                data.condition3 = string.Intern(rowData[10]);
            }
            if (!string.IsNullOrEmpty(rowData[11]))
            {
                data.conditionReward3 = string.Intern(rowData[11]);
            }
            if (!string.IsNullOrEmpty(rowData[12]))
            {
                data.conditionText3 = string.Intern(rowData[12]);
            }
            if (!string.IsNullOrEmpty(rowData[13]))
            {
                data.bossPicture = rowData[13];
            }
            if (!string.IsNullOrEmpty(rowData[14]))
            {
                data.normalReward = rowData[14];
            }
            if (!string.IsNullOrEmpty(rowData[15]))
            {
                data.sweepItem = string.Intern(rowData[15]);
            }
            if (!string.IsNullOrEmpty(rowData[16]))
            {
                data.isBooss = int.Parse(rowData[16]);
            }
            return data;
        }
    }
}
